package cc.mrbird.febs.business.domain;

import cc.mrbird.febs.common.converter.TimeConverter;
import cc.mrbird.febs.common.domain.RegexpConstant;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wuwenze.poi.annotation.Excel;
import com.wuwenze.poi.annotation.ExcelField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

@Data
@TableName("t_b_store")
@Excel("商户信息表")
@ApiModel(value="商户信息表",description="商户信息表")
public class Store implements Serializable {

    private static final long serialVersionUID = -1714476694755654924L;

    @TableId(value = "store_id", type = IdType.AUTO)
    private Long storeId;

    /**
     * 小区 ID
     */
    @TableId(value = "comm_id")
    private Long commId;

    @NotBlank(message = "{required}")
    @Size(max = 10, message = "{noMoreThan}")
    @ExcelField(value = "商户名称")
    @ApiModelProperty(value = "商户名称")
    private String storeName;

    @Pattern(regexp = RegexpConstant.MOBILE_REG, message = "{mobile}")
    @ExcelField(value = "手机号")
    @ApiModelProperty(value = "手机号")
    private String mobile;

    @ExcelField(value = "地址")
    @ApiModelProperty(value = "地址")
    private String address;

    @ExcelField(value = "商户图片")
    @ApiModelProperty(value = "商户图片")
    private String fileurl;

    @ExcelField(value = "开店时间")
    @ApiModelProperty(value = "开店时间")
    private Date opentime;

    @ExcelField(value = "下班时间")
    @ApiModelProperty(value = "下班时间")
    private Date closetime;

    @Size(max = 50, message = "{noMoreThan}")
    @ExcelField(value = "商户简介")
    @ApiModelProperty(value = "商户简介")
    private String remark;

    @ExcelField(value = "商户类型")
    @ApiModelProperty(value = "商户类型")
    private String storeType;

    @ExcelField(value = "创建时间", writeConverter = TimeConverter.class)
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ExcelField(value = "修改时间", writeConverter = TimeConverter.class)
    @ApiModelProperty(value = "修改时间")
    private Date modifyTime;

    /**
     * 商户类型
     */
    public enum sType {
        FOOD(1, "美食"),
        PRETTY(2, "美容美发"),
        MASSAGE(3, "按摩理疗"),
        CLINIC(4, "诊所药店"),
        EDU(5, "托班早教"),
        SUP(6,"超市菜场"),
        KEEP(7,"瑜伽健身"),
        HOUSE(8,"家政维修"),
        OTHER(9,"其他");

        private Integer value;
        private String name;

        sType(Integer value, String name) {
            this.value = value;
            this.name = name;
        }

        public Integer getValue() {
            return value;
        }
    }
}